package com.itheima.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.entity.LogQueryParam;
import com.itheima.entity.OperateLog;
import com.itheima.entity.PageBean;
import com.itheima.mapper.LogMapper;
import com.itheima.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description LogServiceImpl
 * @Author 你的名字拼接或昵称
 * @Date 2025-09-08
 */
@Service
public class LogServiceImpl implements LogService {

@Autowired
private LogMapper logMapper;

    @Override
    public PageBean getPage(LogQueryParam logQueryParam) {
        PageHelper.startPage(logQueryParam.getPage(),logQueryParam.getPageSize());
        List<OperateLog> operateLogList=logMapper.getPage(logQueryParam);
        Page p=(Page) operateLogList;
        return new PageBean(p.getTotal(),p.getResult());
    }
}
